package com.sydx.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @Author zoutr
 * @Description
 * @Date 2021/6/30
 **/
@Controller
public class LogoutController {

    // 退出后session对象失效，所以传参为session
    @GetMapping("/logout")
    public String logout(HttpSession session){
        session.invalidate();
        return "redirect:login";
    }
}
